
function goPage(url) {
	var page = document.getElementsByName("gotoPageNum")[0];
	var gotoPageNum = page.value;
	var totalPages = document.getElementsByName("totalPages")[0].value;
	if (!isPosInt(gotoPageNum)) {
		alert("\u8bf7\u8f93\u5165\u6b63\u6574\u6570!");
		page.value="";
		page.focus();
		return false;
	} else {
		if (gotoPageNum > totalPages) {
			alert("\u60a8\u8f93\u5165\u7684\u9875\u7801\u8d85\u51fa\u4e86\u8303\u56f4!");
			page.value="";
			page.focus();
			return false;
		} else {
			if (document.forms.ec.ec_eti) {
				document.forms.ec.ec_eti.value = "";
			}
			document.forms.ec.ec_p.value = gotoPageNum;
			document.forms.ec.setAttribute("action", url);
			document.forms.ec.setAttribute("method", "post");
			document.forms.ec.submit();
		}
	}
}
function selectall() {
	if(document.getElementsByName("docId").length>0){
		var totalDocs = document.getElementsByName("docId").length;
		var selectAll = document.getElementsByName("selectAll")[0].value;
		var temp;
		if (totalDocs == null) {
			totalDocs = 1;
		}
		if (totalDocs == 1) {
			if (selectAll == "0") {
				document.getElementsByName("selectAll")[0].value = "1";
				document.getElementsByName("selectAll")[0].checked = true;
			} else {
				document.getElementsByName("selectAll")[0].value = "0";
				document.getElementsByName("selectAll")[0].checked = false;
			}
		} else {
			if (selectAll == "0") {
				document.getElementsByName("selectAll")[0].value = "1";
				var docs = document.getElementsByName("docId");
				for (var i = 0; i < totalDocs; i++) {
					temp = docs[i];
					temp.checked = true;
				}
			} else {
				document.getElementsByName("selectAll")[0].value = "0";
				var docs = document.getElementsByName("docId");
				for (var i = 0; i < totalDocs; i++) {
					temp = docs[i];
					temp.checked = false;
				}
			}
		}
	}
}
function goFirstPage() {
	var js = document.getElementsByName("action_firstPage")[0].value;
	eval(js);
}
function goPrevPage() {
	var js = document.getElementsByName("action_prevPage")[0].value;
	eval(js);
}
function goNextPage() {
	var js = document.getElementsByName("action_nextPage")[0].value;
	eval(js);
}
function goLastPage() {
	var js = document.getElementsByName("action_lastPage")[0].value;
	eval(js);
}
function init() {
	var prevBtn =document.getElementById("prevBtn");
	var nextBtn =document.getElementById("nextBtn");
	var firstBtn =document.getElementById("firstBtn");
	var lastBtn =document.getElementById("lastBtn");
	var enable_prevPage = document.getElementsByName("enable_prevPage")[0].value;
	var enable_nextPage = document.getElementsByName("enable_nextPage")[0].value;
	var enable_firstPage = document.getElementsByName("enable_firstPage")[0].value;
	var enable_lastPage = document.getElementsByName("enable_lastPage")[0].value;
	var statusMessegeHtml = document.getElementsByName("statusMessegeHtml")[0].value;
	var statusMessege = document.getElementById("statusMessege");
	if(enable_prevPage=="yes"){
		prevBtn.disabled=false;
	}
	else
		prevBtn.disabled=true;
	if(enable_nextPage=="yes")
		nextBtn.disabled=false;
	else
		nextBtn.disabled=true;
	if(enable_firstPage=="yes")
		firstBtn.disabled=false;
	else
		firstBtn.disabled=true;
	if(enable_lastPage=="yes")
		lastBtn.disabled=false;
	else
		lastBtn.disabled=true;
	statusMessege.innerHTML = statusMessegeHtml;
	//document.getElementById('listContainer').style.height=document.body.clientHeight-88+'px';
}

